import { defineComponent, shallowRef, onMounted, onUnmounted, mergeProps, useSSRContext } from "vue";
import { ssrRenderAttrs } from "vue/server-renderer";
import { useEventListener } from "@vueuse/core";
import Viewer from "viewerjs";
const viewer = "";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "PinchScrollZoomModal",
  __ssrInlineRender: true,
  props: {
    imgSrc: {},
    options: {}
  },
  emits: ["hide"],
  setup(__props, { emit: emits }) {
    const props = __props;
    const viewer2 = shallowRef();
    const imgRef = shallowRef();
    const defaultOptions = {
      navbar: false,
      toolbar: false,
      title: false,
      tooltip: false
    };
    const hiddenPreviewer = () => emits("hide");
    onMounted(() => {
      useEventListener(imgRef.value, "hide", hiddenPreviewer);
      if (imgRef.value) {
        viewer2.value = new Viewer(imgRef.value, Object.assign(defaultOptions, props.options));
        viewer2.value.show();
      }
    });
    onUnmounted(() => {
      var _a;
      (_a = viewer2.value) == null ? void 0 : _a.destroy();
    });
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<img${ssrRenderAttrs(mergeProps({
        ref_key: "imgRef",
        ref: imgRef,
        src: props.imgSrc,
        alt: "",
        style: { "display": "none" }
      }, _attrs))}>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/pinch-scroll-zoom/PinchScrollZoomModal.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as _
};
